package com.guoxue.dao.impl;



import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IRecordConfigDao;
import com.guoxue.domain.RecordConfigVo;
@Repository
public class RecordConfigDaoImpl extends BaseDaoImpl<RecordConfigVo> implements IRecordConfigDao{
	
	public void saveRecordConfig(RecordConfigVo recordConfig) {
		saveOrUpdate(recordConfig);
	}
	
	public List<RecordConfigVo> getRecordConfigList() {
		return find("from RecordConfigVo");
	}

	@Override
	public List<RecordConfigVo> getRecordConfigList(int beginWordId, int endWordId) {
		return find("FROM RecordConfigVo r WHERE r.wordId >= ? AND r.wordId <= ?", new Object[] {beginWordId,endWordId});
	}

	@Override
	public void deleteRecordConfig(int id) {
		executeHql("DELETE FROM RecordConfigVo r WHERE r.wordId=?", new Object[] {id});
	}

	@Override
	public RecordConfigVo getRecordConfig(int beginWordId, int endWordId) {
		return get("FROM RecordConfigVo r WHERE r.wordId >= ? AND r.wordId <= ?", new Object[] {beginWordId,endWordId});
	}
	
}
